package com.jrx.anytxn.transaction.bean;

import com.jrx.anytxn.common.annotation.MethodType;
import com.jrx.anytxn.common.constant.CommonContants;
import com.jrx.anytxn.transaction.constant.TransBizConstant;
import com.jrx.anytxn.transaction.entity.*;
import org.apache.commons.collections.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 抛账 更新实体
 *
 * @author cbd
 */
public class CastAccountBean {

    private List<AmInterestAccrualInfo> interestAccrualInfoList = new ArrayList<>();

    private List<AmAccountMainInfo> accountMainInfoList = new ArrayList<>();

    private List<AmLoanAccountInfo> updateLoanAccounList = new ArrayList<>();

    private List<AmRepaymentPlanInfo> updateRepaymentPlanList = new ArrayList<>();

    private List<TlTransactionInfo> transactionInfoList = new ArrayList<>();

    private List<TlGlInterfaceInfo> glInterfaceInfoList = new ArrayList<>();

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmWaiveRepaymentPlanInfo> getUpdateWaiveRepaymentPlanList() {
        return updateWaiveRepaymentPlanList;
    }

    public void setUpdateWaiveRepaymentPlanList(List<AmWaiveRepaymentPlanInfo> updateWaiveRepaymentPlanList) {
        this.updateWaiveRepaymentPlanList = updateWaiveRepaymentPlanList;
    }

    private List<AmWaiveRepaymentPlanInfo> updateWaiveRepaymentPlanList = new ArrayList<>();

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<AmInterestAccrualInfo> getInterestAccrualInfoList() {
        return interestAccrualInfoList;
    }

    public void setInterestAccrualInfoList(List<AmInterestAccrualInfo> interestAccrualInfoList) {
        this.interestAccrualInfoList = interestAccrualInfoList;
    }

    public void addInterestAccrualInfo(AmInterestAccrualInfo amInterestAccrualInfo) {
        if(null != amInterestAccrualInfo) {
            this.interestAccrualInfoList.add(amInterestAccrualInfo);
        }
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<AmAccountMainInfo> getAccountMainInfoList() {
        return accountMainInfoList;
    }

    public void setAccountMainInfoList(List<AmAccountMainInfo> accountMainInfoList) {
        this.accountMainInfoList = accountMainInfoList;
    }

    public void addAccountMainInfo(AmAccountMainInfo amAccountMainInfo) {
        this.accountMainInfoList.add(amAccountMainInfo);
    }

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmLoanAccountInfo> getUpdateLoanAccounList() {
        return updateLoanAccounList;
    }

    public void setUpdateLoanAccounList(List<AmLoanAccountInfo> updateLoanAccounList) {
        this.updateLoanAccounList = updateLoanAccounList;
    }

    public void addUpdateLoanAccount(AmLoanAccountInfo loanAccountInfo) {
        this.updateLoanAccounList.add(loanAccountInfo);
    }

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmRepaymentPlanInfo> getUpdateRepaymentPlanList() {
        return updateRepaymentPlanList;
    }

    public void setUpdateRepaymentPlanList(List<AmRepaymentPlanInfo> updateRepaymentPlanList) {
        this.updateRepaymentPlanList = updateRepaymentPlanList;
    }

    public void addUpdateRepaymentPlan(AmRepaymentPlanInfo repaymentPlanInfo) {
        this.updateRepaymentPlanList.add(repaymentPlanInfo);
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<TlTransactionInfo> getTransactionInfoList() {
        return transactionInfoList;
    }

    public void setTransactionInfoList(List<TlTransactionInfo> transactionInfoList) {
        this.transactionInfoList = transactionInfoList;
    }

    public void addTransactionInfoList(TlTransactionInfo tlTransactionInfo) {
        this.transactionInfoList.add(tlTransactionInfo);
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<TlGlInterfaceInfo> getGlInterfaceInfoList() {
        return glInterfaceInfoList;
    }

    public void setGlInterfaceInfoList(List<TlGlInterfaceInfo> glInterfaceInfoList) {
        this.glInterfaceInfoList = glInterfaceInfoList;
    }

    public void addTlGlInterfaceInfo(TlGlInterfaceInfo gl){
        if(null != gl){
            this.glInterfaceInfoList.add(gl);
        }
    }

    public void addAllTlGlInterfaceInfo(List<TlGlInterfaceInfo> glList){
        if(CollectionUtils.isNotEmpty(glList)){
            this.glInterfaceInfoList.addAll(glList);
        }
    }

    public void addAccuIntrList(List<AmInterestAccrualInfo> interestAccrualInfoList) {
        if(CollectionUtils.isNotEmpty(interestAccrualInfoList)){
            this.interestAccrualInfoList.addAll(interestAccrualInfoList);
        }
    }
}
